//
//  UserCell.m
//  NewNest
//
//  Created by hesiyao on 16/1/16.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "UserCell.h"

@implementation UserCell

-(void)dealloc
{
    [_imageview release];
    [_nameLabel release];
    [super dealloc];
}
/// 初始化方法
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageview = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageview];
        [_imageview release];
        
        self.nameLabel = [[UILabel alloc] init];
//        _nameLabel.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_nameLabel];
        [_nameLabel release];
    }
    return self;
}

/// 布局方法
-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    
    self.imageview.frame = CGRectMake(0, 0, self.contentView.frame.size.width - 40, self.contentView.frame.size.width - 40);
    _imageview.center = CGPointMake(self.contentView.center.x, self.contentView.center.y);
    self.nameLabel.frame = CGRectMake(10, _imageview.frame.origin.y + _imageview.frame.size.height + 10, self.contentView.frame.size.width - 20, 15);
    _nameLabel.font = [UIFont systemFontOfSize:12];
    
}

@end
